package ui.adapter;

import android.graphics.Color;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fy.fyzf.R;
import com.fy.fyzf.base.BaseApp;
import com.fy.fyzf.bean.PriceFilterBean;

import java.util.List;

public class PriceFilterAdapter extends BaseQuickAdapter<PriceFilterBean, BaseViewHolder> {

    public PriceFilterAdapter() {
        super(R.layout.item_price_filter);
    }

    private int select = -1;
    public void setSelect(int i){
        select = i;
        notifyDataSetChanged();
    }
    @Override
    protected void convert(BaseViewHolder helper, PriceFilterBean item) {
        helper.setText(R.id.tv_title,item.getTitle());
        if (select == helper.getAdapterPosition()) {
            helper.setTextColor(R.id.tv_title, BaseApp.getContext().getResources().getColor(R.color.color_theme));
        } else {
            helper.setTextColor(R.id.tv_title, Color.GRAY);
        }
    }
}
